package com.mypkg.beans;

import java.util.ArrayList;

import com.mypkg.controls.BasicControl;


public class ButtonBean {
	private String value;
	private String idBut;
	private String someAttribs;
	
	public String getSomeAttribs() {
		return someAttribs;
	}

	public void setSomeAttribs(String someAttribs) {
		this.someAttribs = someAttribs;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}
	
	public String render()
	{
		ArrayList<String> attriButton = new ArrayList<String>();
		attriButton.add("type='button'");
		if (!this.value.isEmpty())
		attriButton.add("value='"+this.value+"'");
		attriButton.add("id='"+this.idBut+"'");
		if (this.someAttribs != null)
			attriButton.add(someAttribs);
		BasicControl bc = new BasicControl();
		bc.setAttributesForControl(attriButton);
		bc.setControlType("input");
		return bc.renderFunction();
	}

	public String getIdBut() {
		return idBut;
	}

	public void setIdBut(String idBut) {
		this.idBut = idBut;
	}
}
